using System;
using System.Collections;

namespace BEGDC.CC.BL.Workflow
{
	/// <summary>
	/// Represent all workflow execution functions
	/// </summary>
	public interface IExecute
	{
		/// <summary>
		///  When implemented by a class, start an new cq process
		/// </summary>
		/// <returns>process instance flow id</returns>
		long StartProcess();
//
//		/// <summary>
//		///  When implemented by a class, start an new cr process
//		/// </summary>
//		/// <returns>process instance flow id</returns>
//		long StartCRProcess(System.Collections.Hashtable attributes);

//		/// <summary>
//		///  When implemented by a class, start an new CCC TQ support process
//		/// </summary>
//		/// <returns>process instance flow id</returns>
//		long StartCCCProcess();
//
//		/// <summary>
//		/// When implemented by a class, start a new CCC TS process
//		/// </summary>
//		/// <returns></returns>
//		long StartTSProcess();

		/// <summary>
		/// When implemented by a class, start an new process by specified definition id
		/// </summary>
		/// <param name="pdID">definition id</param>
		/// <returns>process instance flow id</returns>
		long StartProcess(long pdID);

		/// <summary>
		/// When implemented by a class, execute the workflow activity by specified flow ID
		/// </summary>
		/// <param name="flowID">Flow ID</param>
		void PerformActivity(long flowID);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		void PerformTSActivity( long flowID );

		/// <summary>
		/// When implemented by a class, execute the decision activity by specified flow ID
		/// </summary>
		/// <param name="flowID">Flow ID</param>
		/// <param name="isYes">Decision Result</param>
		void PerformDecision(long flowID, bool isYes);

		/// <summary>
		/// When implemented by a class, execute the activity by specified flow ID and transition.
		/// </summary>
		/// <param name="flowID">Flow ID</param>
		/// <param name="nextTransition">Next Transition</param>
		void PerformActivity(long flowID, string nextTransition);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		/// <param name="nextTransition"></param>
		void PerformTSActivity(long flowID, string nextTransition);
		
		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowId"></param>
		/// <param name="actorId"></param>
		void DelegateActivity(Int64 flowId, string actorId);

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		IList GetTaskList();

//		/// <summary>
//		/// 
//		/// </summary>
//		/// <returns></returns>
//		IList GetTSTaskList();

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		void DrawbackActivity(long flowID);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		/// <param name="stateID"></param>
		void MoveFlowState(long flowID, long stateID, string type);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		/// <param name="stateKey"></param>
		void MoveFlowState(long flowID, string stateKey, string type);

//		void MoveFlowState(long flowID, string stateKey, string statusFlag);

//		/// <summary>
//		/// 
//		/// </summary>
//		/// <param name="flowID"></param>
//		/// <param name="stateID"></param>
//		//void MoveAskForMoreState(Project project, Employee employee, long stateID);
//		void MoveAskForMoreState(Project project, Employee employee, string StateKey, string comment);

//		void FinishAskForMoreState(Project project);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		void CancelFlow(long flowID);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		/// <returns></returns>
//		CODMActivityState GetPreviousActivityState(long flowID);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		/// <param name="stateID"></param>
		void QueryActiity(long flowID, long stateID);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		/// <param name="stateKey"></param>
		void QueryActiity(long flowID, string stateKey);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="flowID"></param>
		void FinishQuery(long flowID);
	}
}
